<script type="text/javascript" src="/ueditor/ueditor.config.js"></script>
<!-- 编辑器源码文件 -->
<script type="text/javascript" src="/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="/ueditor/kityformula-plugin/addKityFormulaDialog.js"></script>
<script type="text/javascript" charset="utf-8" src="/ueditor/kityformula-plugin/getKfContent.js"></script>
<script type="text/javascript" charset="utf-8" src="/ueditor/kityformula-plugin/defaultFilterFix.js"></script>
<script type="text/javascript" src="/My97DatePicker/WdatePicker.js"></script>
<style>
    #login-button{
        margin-top: 20px;
        background: #286090!important;
        color: white!important;
        border: 1px solid #286090!important;
        border-radius: 3px;
    }
</style>
<div class="span10">
    <div style="margin-bottom: 20px;">
        <a>首页</a>
        <span >&gt;</span>
        <span>讲师管理</span>
        <span >&gt;</span>
        <span>添加</span>
    </div>
    <form class="form" method="post" action="<?php echo baseUrl."/content/teachers/add"?>" enctype="multipart/form-data">
        <table>
            <tr>
                <td width="80px">姓名 *:</td>
                <td><input type="text" name="name" value="<?php echo isset($data)?$data['name']:''?>" placeholder="讲师名"></td>
            </tr>

                    <?php if(isset($data)) {
                        $str = '<tr>';
                        $str .= '<td>原图片:</td>';
                        $str .= '<td>';
                        $pic = $data['pic'];
                        $str .= "<input name='pic' type='text' value='" . $pic . "'></td></tr>";
                        echo $str;
                    } ?>

            <tr>
                <td width="120px">上传、修改图片 *:</td>
                <td>
                   <input id="file" type="file" name="pic" >
                </td>
            </tr>
            <tr>
                <td>简介 *:</td>
                <td>
                    <textarea style="width: 600px;height: 100px" name="smallIntro"><?php echo isset($data['smallIntro']) ? $data['smallIntro'] : '' ?></textarea>
            </tr>
            <tr>
                <td>主讲课程*:</td>
                <td><input type="text" name="subject" value="<?php echo isset($data)?$data['subject']:''?>" placeholder="主讲课程" ></td>
            </tr>
            <tr>
                <td>是否置顶:</td>
                <td>
                    <select name="isTop">
                        <option value ="1" <?php echo isset($data)&& $data['isTop']=="1" ?  'selected':''?>>是</option>
                        <option value ="0" <?php echo isset($data)&& $data['isTop']=="0" ?  'selected':''?>>否</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>教师级别:</td>
                <td>
                    <select name="seniority">
                        <option value="">请选择等级</option>
                        <option value="1" <?php echo isset($data) && $data['seniority'] == "1" ? 'selected' : '' ?>>雅思首席讲师</option>
                        <option value="2" <?php echo isset($data) && $data['seniority'] == "2" ? 'selected' : '' ?>>雅思总监讲师</option>
                        <option value="3" <?php echo isset($data) && $data['seniority'] == "3" ? 'selected' : '' ?>>雅思金牌讲师</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>授课视频试听sdk口令：</td>
                <td><input type="text" style="width: 600px;" name="url" placeholder="" value="<?php echo isset($data)? $data['url']:''?>"/></td>
            </tr>
            <tr>
                <td>授课视频标题：</td>
                <td><input type="text" name="course_title" placeholder="" value="<?php echo isset($data)? $data['course_title']:''?>"/></td>
            </tr>
            <?php if(isset($data)) {
                $str = '<tr>';
                $str .= '<td>授课视频封面图：</td>';
                $str .= '<td>';
                $course_image = $data['course_image'];
                $str .= "<input name='course_image' type='text' value='" . $course_image . "'></td></tr>";
                echo $str;
            } ?>
            <tr>
                <td>授课视频封面图：</td>
                <td>
                     <input id="file" type="file" name="course_image" >
                </td>
            </tr>
            <tr>
                <td>授课视频播放次数：</td>
                <td><input type="text" name="course_views" placeholder="" value="<?php echo isset($data)? $data['course_views']:''?>"/></td>
            </tr>
            <tr>
                <td>授课视频标签：</td>
                <td><input type="text" name="course_tag" placeholder="" value="<?php echo isset($data)? $data['course_tag']:''?>"/></td>
            </tr>
            <?php if(isset($data)) {
                $str = '<tr>';
                $str .= '<td>原课程介绍图片:</td>';
                $str .= '<td>';
                $course_description = $data['course_description'];
                $str .= "<input name='course_description' type='text' value='" . $course_description . "'></td></tr>";
                echo $str;
            } ?>
            <tr>
                <td>授课视频课程介绍图片：</td>
                <td>
                     <input id="file" type="file" name="course_description" >
                </td>
            </tr>
            <tr>
                <td>学员口碑 *:</td>
                <td>
                    <textarea style="width: 600px;height: 100px" name="student_word"><?php echo isset($data['student_word']) ? $data['student_word'] : '' ?></textarea>
            </tr>
            <tr>
                <td>授课年限:</td>
                <td><input type="text" style="width: 600px;" name="year" placeholder="" value="<?php echo isset($data)? $data['year']:''?>"/></td>
            </tr>
            <tr>
                <td>上传人:</td>
                <td><input type="text" name="author" value="<?php echo isset($data)?$data['author']:''?>" placeholder="anthor" ></td>
            </tr>
            <tr>
                <td>描述 *:</td>
                <td id="introduction">
                  <textarea style="width: 800px" id="editor" class="editor"
                            name="introduction"><?php echo isset($data)?$data['introduction']:''?></textarea>
                    <script>var editor = UE.getEditor('editor');</script>
                </td>
            </tr>
            <tr>
                <td>排序:</td>
                <td><input type="text" name="sort" value="<?php echo isset($data)?$data['sort']:''?>" placeholder="排序" ></td>
            </tr>
            <tr>
                <td colspan="2" align="right">
                    <input type="hidden" name="id" value="<?php echo isset($data)?$data['id']:''?>"/>
                    <button type="submit" id="login-button">添加/修改</button></td>
            </tr>
            <input type="hidden" name="_csrf" value="<?=Yii::$app->request->getCsrfToken()?>" />
        </table>
    </form>
</div>